refactor: pre-1.0 state API naming and signature polish#140
Merged
Conversation
Signed-off-by: Joshua Temple <[email protected]>
Signed-off-by: Joshua Temple <[email protected]>
Signed-off-by: Joshua Temple <[email protected]>
Signed-off-by: Joshua Temple <[email protected]>
Signed-off-by: Joshua Temple <[email protected]>
Signed-off-by: Joshua Temple <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this change does
Pre-1.0 naming and signature polish on the
statepublic API, from an early-adopter audit. Four focused changes (atomic commits), all pre-tag so they stay out of the frozen 1.0 surface:Invoke(src, ...InvokeOption)/InvokeActor(src, ...InvokeOption)withWithInvokeOnDone(E)/WithInvokeOnError(E), mirroring the existingWithSpawnOnDone/OnError. This was the one place the project broke its own functional-options pattern; moving outcomes off the positional signature letsonCancel/ fire-and-forget arrive additively instead of as a future break. Behavior is unchanged for callers that set both.Registry.Assignis renamed toRegistry.Reducer(matchingBuilder.Reducer), andAssignis reserved for the transition-wiring verb. This mirrors the existingGuard/WhenandAction/Doregister-noun / wire-verb split, so no single word means two things. TheAssignFntype is unchanged.StopChildcollapsed intoStopActor. Both emitted the identicalStopActoreffect; one verb now, aligned withSpawn/SpawnActor.Tick.ServiceRunner.RunandActorSystem.StepbecomeTick, matchingScheduler.Tickand the already-consistentAbsorb/Pending/SettleDone/SettleErrorset.Plus godoc cross-references across the
Fire/FireSeq/FireEachfamily.Why
The audit found the surface in good shape; these are the few items genuinely worth fixing before contracts freeze, biased toward extensibility and developer experience. The
Verifyrename (PR #139) set the precedent: favor discoverability and additive-friendly signatures over cleverness.Note: the
Tickverb is unified across the three drivers, but their return shapes intentionally still differ (ServiceRunner.Ticksettles one service and returns(FireResult, bool); the others return[]FireResult). Unifying return shapes is a separate, larger call left for later.Checklist
git commit -s) per the DCOtype: subject)statebuild/test/vet green;source+source/statemachine(the only consumer) green; docsgen clean